package hos.http;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentLinkedQueue;

/**
 * <p>Title: HttpTag </p>
 * <p>Description:  </p>
 * <p>Company: www.mapuni.com </p>
 *
 * @author : 蔡俊峰
 * @version : 1.0
 * @date : 2023/3/1 21:52
 */
public interface HttpTag {

    class UrlAndBody {
        public UrlAndBody(HttpBaseRequest<?> request) {
            url = request.getQueryUrl();
            header = request.getHeader();
            body = request.getBodyParameters();
        }

        public String url;
        public Map<String, String> header;
        public List<HttpParam> body;

        public Map<String, Object> getBody() {
            if (body == null) {
                return null;
            }
            Map<String, Object> map = new HashMap<>();
            for (HttpParam httpParam : body) {
                map.put(httpParam.key, httpParam.value);
            }
            return map;
        }
    }

    class UploadListeners extends ConcurrentLinkedQueue<ProgressListener> {
    }

    class DownloadListeners extends ConcurrentLinkedQueue<ProgressListener> {

        public String fileDir;

        public boolean isMD5Verify = false;

        public boolean isTempFile = false;

        public boolean isFileNameDecode = true;

        public String fileName;
        public boolean conflictRename = true;

    }

    class Soap {

        public String name;

        public Soap(String name) {
            this.name = name;
        }
    }
}
